﻿using Abp.AutoMapper;
using Paas.Core.Documents.Entities;
using Newtonsoft.Json;
using Basefr.App.Dtos;
using System.Collections.Generic;
using System.Linq;

namespace Paas.App.Interface.Documents.Dtos
{
    [AutoMap(typeof(DocumentFolder))]
    public class DocumentFolderDto : DtoBase
    {
        public string Key => Id.ToString();

        public int? ParentId { get; set; }
        public string ParentName { get; set; }

        [JsonProperty("title")]
        public string Name { get; set; }

        public string FullName { get; set; }

        public bool IsLeaf => !(Children?.Any() ?? false);

        public List<DocumentFolderDto> Children { get; set; }
    }
}

